From 63c48d1826edf164a5cd5124dc04c64b7e4ffbfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 26 Apr 2012 01:17:41 +0200 Subject: [PATCH] add babl_format_get_model --- babl/babl-format.c | 12 ++++++++++++ babl/babl.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/babl/babl-format.c b/babl/babl-format.c index 7f43911..0a7a840 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -653,4 +653,16 @@ babl_set_user_data (const Babl *cbabl, void *data) } } +const Babl * +babl_format_get_model (const Babl *format) +{ + if (format->class_type == BABL_FORMAT) + { + return (Babl*)format->format.model; + } + return NULL; +} + BABL_CLASS_IMPLEMENT (format) + + diff --git a/babl/babl.h b/babl/babl.h index 5e6cf42..c1c5e9d 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -104,6 +104,11 @@ int babl_format_has_alpha (const Babl *format); */ int babl_format_get_bytes_per_pixel (const Babl *format); +/** + * Return the model used for constructing the format. + */ +const Babl * babl_format_get_model (const Babl *format); + /** * Returns the number of components for the given @format. */ -- 2.30.2